package com.bawei.base

import android.app.Application
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.tencent.mmkv.MMKV
import com.tencent.smtt.sdk.QbSdk

/**
 * Author: Jason Zhang
 * Date: 2024/4/26
 * Desc: 基础Application
 */
open class BaseApplication: Application() {

    override fun onCreate() {
        super.onCreate()
        //初始化MMKV
        MMKV.initialize(this)

        if(BuildConfig.DEBUG){
            ARouter.openLog()
            ARouter.openDebug()
        }
        //初始化ARouter
        ARouter.init(this)

        //初始化X5浏览器内核
        QbSdk.initX5Environment(applicationContext, object : QbSdk.PreInitCallback{
            override fun onCoreInitFinished() {
                Log.i("App", "onCoreInitFinished: X5内核初始化完成")
            }

            override fun onViewInitFinished(status: Boolean) {
                Log.i("App", "onViewInitFinished: X5浏览器初始化完成")
            }

        })

    }

}